#pragma once
#include <mutex>
template<class T>
class Singleton
{
protected:
	Singleton() {}
public:
	~Singleton() {}
	static T& GetInstance()
	{
		mtxSingleton.lock();
		static T t;
		mtxSingleton.unlock();
		return t;
	}
private:
	static mutex mtxSingleton;
};
template<class T>
std::mutex Singleton<T>::mtxSingleton;